package com.ai.wxy.spring.jpa.user.dto;

import com.ai.spring.common.annotation.AddGroup;
import com.ai.spring.common.annotation.EditGroup;
import com.ai.wxy.spring.service.api.dto.ServiceParam;
import com.ai.wxy.spring.service.api.dto.ServiceResult;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 角色
 *
 * @author 石头
 * @Date 2019/11/20
 * @Version 1.0
 **/
@Data
public class RoleDTO implements ServiceParam {
    @NotNull(groups = EditGroup.class,message = "角色ID不能为空")
    private Long id;
    /**角色ID*/
    private Long roleId;
    /**角色名称*/
    @NotBlank(groups = AddGroup.class,message = "角色名称不能为空")
    @Pattern(regexp = "(?=[a-zA-Z])(?:[a-z0-9A-Z])[a-z0-9A-Z-|_]{6,10}",message = "格式错误【用户名称为字母开头且只能包含字母，数字或是-_,且长度为6~10位】")
    private String roleName;
    /**角色编码*/
    @NotBlank(groups = AddGroup.class,message = "角色编码不能为空")
    @Pattern(regexp = "(?=[a-zA-Z])(?:[a-zA-Z])[a-z0-9A-Z|_]{6,10}",message = "格式错误【角色编码为字母开头且只能包含字母，数字或是_,且长度为6~10位】")
    private String roleCode;
    /**描述*/
    private String desc;
}
